/*
 *    Copyright (c) 2018-2025, nart All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: nart
 */

package com.nai365.nart.operation.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nai365.nart.operation.dto.PledgeParamDto;
import com.nai365.nart.operation.dto.PledgeRecordDto;
import com.nai365.nart.operation.entity.PledgeRecord;
import com.nai365.nart.product.entity.SkuInfo;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.Serializable;
import java.util.List;

/**
 * 质押记录
 *
 * @author baogs
 * @date 2022-07-01 11:13:17
 */
public interface PledgeRecordService extends IService<PledgeRecord> {

	/**
	 * 质押
	 *
	 * @param pledgeParam 质押参数
	 * @return 质押记录
	 */
	PledgeRecordDto pledge(PledgeParamDto pledgeParam) throws Exception;

	List<SkuInfo> findAblePledgeSku(Long pledgeDemandId);

	Page<PledgeRecordDto> page(Page<PledgeRecord> page, QueryWrapper<PledgeRecord> queryWrapper);


	/**
	 * 取消质押
	 *
	 * @param pledgeRecordId 质押记录Id
	 * @return PledgeRecordDto
	 */
	PledgeRecordDto cancel(@RequestParam Long pledgeRecordId);

	/**
	 * 查询质押记录详情
	 *
	 * @param id 质押记录Id
	 * @return PledgeRecordDto
	 */
	PledgeRecordDto getPledgeRecordDtoById(Long id);


}
